package com.ruoyi.system.task;

import com.ruoyi.system.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class UserNumberResetTask {

    @Autowired
    private IUserInfoService userInfoService;

    /**
     * 每天一点半执行一次，重置所有用户的number字段为空
     */
    @Scheduled(cron = "0 30 1 * * ?")
    public void resetAllUserNumberTask() {
        int rows = userInfoService.resetAllUserNumber();
        System.out.println("定时任务：已重置所有用户的number字段为空，受影响行数：" + rows);
    }
} 